<?php $this->load->view('common/head');?>
    <form class="form-inline" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post" enctype="multipart/form-data" id="fileAdd" name="fileAdd">
      <input type="hidden" name="id" id="id" value="<?=isset($noticeData) ? $noticeData['id'] : ''?>">
      <table class="table ">
        <thead>
          <tr>
            <th colspan="2" class="text-center">公告信息</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="col-sm-2"><label for="title" class="control-label">公告标题：</label></td>
            <td class="text-left">
                <input type="input" class="form-control" style="width:400px;" name="title" id="title" value="<?=isset($noticeData) ? $noticeData['title'] : ''?>" placeholder="公告标题"> 
            </td>
          </tr>
          <tr>
            <td class="col-sm-2"><label for="displayRole" class="control-label">显示端口：</label></td>
            <td class="text-left">
                <select class="form-control" placeholder=".col-xs-4" id="displayRole" name="displayRole">
                <option value="">请选择显示端口</option>
                <?php foreach ($displayRole as $k => $v) {?>
                <option value="<?=$k?>" <?=$k==$noticeData['displayRole'] ? 'selected="selected"' : ''?>><?=$v?></option>
                <?php } ?>
                </select>
            </td>
          </tr>
          <tr>
            <td class="col-sm-2"><label for="content" class="control-label">广告内容:</label></td>
            <td class="col-sm-10">
              <textarea class="form-control" name="content" id="content"><?=isset($noticeData) ? $noticeData['content'] : ''?></textarea>
            </td>
          </tr>
          <tr>
            <td colspan="2" class="text-center">
              <button type="button" class="btn btn-default btn-primary" role="button" onclick="ajaxFormSubmit('fileAdd')">保存</button>
            </td>
            <td></td>
          </tr>
        </tbody>
      </table>
    </form>
    <script type="text/javascript">
      var editor;
      KindEditor.ready(function(K) {
        editor = K.create('textarea[name="content"]', {
          width : 700,
          height : 350,
          allowFileManager : true,
          uploadJson:"<?=printUrl('Upload','uploadSave')?>",
          fileManagerJson:"<?=printUrl('Upload','uploadManager')?>",
          afterCreate: function(){this.sync();},
          afterBlur: function(){this.sync();},
        });
      });
    </script>
<?php $this->load->view('common/foot');?>